package com.lmabbe.core.service.dao;

import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.lmabbe.core.common.entitys.SysResource;
import com.lmabbe.core.common.entitys.SysRoleResource;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author lmabbe
 */
@Mapper
public interface SysRoleResourceMapper extends BaseMapper<SysRoleResource> {

    /**
     * 根据权限ID查找用户可访问资源
     *
     * @param roleIds 权限ID
     * @return
     */
    @InterceptorIgnore(others = {"dataScope@true"})
    List<SysResource> findResourceByRoleId(@Param("roleIds") List<Long> roleIds);
}